package arch.chameleon.module.security.realm.service.impl;

import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.transaction.annotation.Transactional;

import arch.chameleon.module.security.realm.dao.ShiroDbDao;
import arch.chameleon.module.security.realm.model.SRole;
import arch.chameleon.module.security.realm.model.SUser;
import arch.chameleon.module.security.realm.service.ShiroDbService;

/**
 * @author George
 *
 */
@Transactional(readOnly = true)
public class ShiroDbServiceImpl implements ShiroDbService {


	public SUser findUserByLoginName(String loginName) {
		return shiroDbDao.findByLoginName(loginName);
	}
	
	public List<SRole> findRolesByLoginName(String loginName){
		return shiroDbDao.findRolesByLoginName(loginName);
	}

	private transient Logger logger = LoggerFactory.getLogger(ShiroDbServiceImpl.class);
	
	private ShiroDbDao shiroDbDao;

	public void setShiroDbDao(ShiroDbDao shiroDbDao) {
		this.shiroDbDao = shiroDbDao;
	}

	
}
